package model02;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class ThietBi {
	private String soSeri;
	private String tenThietBi;
	
	//nhap thong tin
	public void nhapThongTin() {
		Scanner s;

		//so seri
		do {
			s = new Scanner(System.in);
			System.out.print("So seri: ");
			soSeri = s.nextLine();
			
			
		} while(soSeri.trim().isEmpty());
		
		//ten tb
		do {
			s = new Scanner(System.in);
			System.out.print("Ten thiet bi: ");
			tenThietBi = s.nextLine();
		} while(tenThietBi.trim().isEmpty());
		
		//hang san xuat
		NhaSanXuat nsx = new NhaSanXuat();
		nsx.nhapThongTin();
	}
	
	//xuat thong tin
	public void xuatThongTin() {
		System.out.println("So seri: " + soSeri);
		System.out.println("Ten thiet bi: " + tenThietBi);
	}
	
	//ghi thong tin ra file
	public void printToFile() throws FileNotFoundException {
		File f = new File("ifothietbi.txt");
		PrintWriter pw = new PrintWriter(f);
		
		pw.print(soSeri);
		pw.print(tenThietBi);
	}

	public String getSoSeri() {
		return soSeri;
	}

	public void setSoSeri(String soSeri) {
		this.soSeri = soSeri;
	}

	public String getTenThietBi() {
		return tenThietBi;
	}

	public void setTenThietBi(String tenThietBi) {
		this.tenThietBi = tenThietBi;
	}
	
}
